<?php

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

/*
 * Make sure the user is authorized to view this page
 */
 /*
$user = & JFactory::getUser();
if (!$user->authorize( 'com_product', 'manage' )) {
	$mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') );
}*/

// Require the base controller
require_once (JPATH_COMPONENT.DS.'controller.php');
require_once (JPATH_COMPONENT.DS.'helpers'.DS.'functions.php');

// Require specific controller if requested
if($controller = JRequest::getCmd('view', 'staff')) {
    $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
    if(file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}

$classname = 'StaffController'.$controller;
$controller = new $classname();

// Perform the Request task
$controller->execute( JRequest::getCmd('task'));
$controller->redirect();